home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / DocShell / ShPrpAcc.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  18.7 KB  |  650 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ShPrpAcc.cpp
  3.  
  4.     Contains:    Implemementation of Shell property accessor classes.
  5.  
  6.     Owned by:    Eric House
  7.  
  8.     Copyright:    © 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.         <15>     9/13/95    TÇ        1249149 FB2: Memory leak/crash fixes
  13.         <14>     8/22/95    eeh        1230007: refbal-inspired cleanup
  14.         <13>     8/15/95    TÇ        1262179 FB: Shell calls BlockMove() in many
  15.                                     places
  16.         <12>     7/25/95    DM        #1270320: Memory leak fixes.
  17.         <11>     6/30/95    TJ        Included TempObj.h
  18.         <10>     6/29/95    DM        1242642 BB: refcounting: release shapes in
  19.                                     SetPropertyData(), comment out ifdef'd
  20.                                     sections.
  21.          <9>     6/25/95    TÇ        1242642 BB: Turn on ODDebug warning if
  22.                                     refcount is wrong in
  23.                                     ODRefCntObjectsomUninit.
  24.          <8>     5/26/95    TJ        Changed Get to Aquire.
  25.          <7>      5/7/95    TÇ        1155852 BB: String constants need to be
  26.                                     moved to resource for Localization (mostly
  27.                                     done)
  28.          <6>     2/20/95    TÇ        #1210979 BB: 5-$ Bugs need to be evaluated
  29.                                     and removed from Shell
  30.          <5>     9/23/94    VL        1155579, 1184272: Use StorUtil to
  31.                                     create/get container and get its file.
  32.          <4>      9/6/94    VL        1184177: Commented out draft::GetName and
  33.                                     draft::SetName as they no longer exist.
  34.          <3>     8/19/94    NP        1181622: Ownership fix.
  35.          <2>     8/10/94    JBS        1179919: coordinate system bias changes
  36.          <1>     6/30/94    TÇ        first checked in
  37.          <0>     6/29/94    SV        SOMverted
  38.          <4>     5/27/94    jpa        New exception support [1165267]
  39.          <3>     3/24/94    eeh        bug# 1151750: scripting support for
  40.                                     operations on draft
  41.          <2>     2/16/94    JA        Include new AltPoint.h.
  42.         <10>      2/8/94    TÇ        Throw -> THROW & some code clean up
  43.          <9>      2/7/94    TÇ        fixes to compile with PPC Headers
  44.          <8>     1/11/94    eeh        removed "frame" from objspec vocab
  45.          <7>    12/17/93    eeh        work on frame bounds property
  46.          <6>     12/9/93    eeh        added ShellSelfPropAccessor and
  47.                                     ShellFramePropAccessor
  48.          <5>    11/30/93    JA        Rearranged #includes for new "frame"
  49.                                     constant fix.
  50.          <4>    11/22/93    SS        Added typecasts for latest headers
  51.          <3>    11/19/93    PH        Fix declarations for braindead CFront
  52.          <2>    11/15/93    eeh        added GetPropertyData and SetPropertyData
  53.          <1>    10/11/93    NP        first checked in
  54.  
  55.     To Do:
  56.         
  57. */
  58.  
  59. #ifndef _PLFMDEF_
  60. #include "PlfmDef.h"
  61. #endif
  62.  
  63.  
  64. #ifndef _ALTPOINT_
  65. #include "AltPoint.h"            // Use C++ savvy ODPoint and ODRect
  66. #endif
  67.  
  68.  
  69. #ifndef _SEUTILS_
  70. #include "SEUtils.h"
  71. #endif
  72.  
  73. #ifndef _RLSHELL_
  74. #include <RlShell.h>
  75. #endif
  76.  
  77. #ifndef SOM_ODWindow_xh
  78. #include <Window.xh>
  79. #endif
  80.  
  81. #ifndef _PASCLSTR_
  82. #include "PasclStr.h"
  83. #endif
  84.  
  85. #ifndef _EXCEPT_
  86. #include "Except.h"
  87. #endif
  88.  
  89. #ifndef _SHPRPACC_
  90. #include "ShPrpAcc.h"
  91. #endif
  92.  
  93. #ifndef SOM_ODPart_xh
  94. #include <Part.xh>
  95. #endif
  96.  
  97. #ifndef SOM_ODFrame_xh
  98. #include <Frame.xh>
  99. #endif
  100.  
  101. #ifndef SOM_ODShape_xh
  102. #include <Shape.xh>
  103. #endif
  104.  
  105. #ifndef _STORUTIL_
  106. #include <StorUtil.h>
  107. #endif
  108.  
  109. #ifndef __RESOURCES__
  110. #include "Resources.h"
  111. #endif
  112.  
  113. #ifndef SOM_ODDocument_xh
  114. #include <Document.xh>
  115. #endif
  116.  
  117. #ifndef _PLFMFILE_
  118. #include <PlfmFile.h>
  119. #endif
  120.  
  121. #ifndef SOM_ODContainer_xh
  122. #include <ODCtr.xh>
  123. #endif
  124.  
  125. #ifndef _ITEXT_
  126. #include "IText.h"
  127. #endif
  128.  
  129. #ifndef __STRING__
  130. #include <string.h>
  131. #endif
  132.  
  133. #ifndef _TEMPOBJ_
  134. #include "TempObj.h"
  135. #endif
  136.  
  137. #pragma segment ShPrpAcc
  138.  
  139. //==============================================================================
  140. // Constants
  141. //==============================================================================
  142.  
  143. //==============================================================================
  144. // Scalar Types
  145. //==============================================================================
  146.  
  147. //==============================================================================
  148. // Local Classes
  149. //==============================================================================
  150.  
  151. //==============================================================================
  152. // Global Variables
  153. //==============================================================================
  154.  
  155. //==============================================================================
  156. // Function Prototype
  157. //==============================================================================
  158.  
  159. //extern pascal void GetAppParms(Str255 apName, short *apRefNum, Handle *apParam)
  160. // ONEWORDINLINE(0xA9F5);
  161. /*
  162.     CountAppFiles, GetAppFiles, ClrAppFiles, GetAppParms, and 
  163.     getappparms are obsolete. They are still supported for 68K 
  164.     apps (if OBSOLETE is defined), but they are not supported 
  165.     for PowerPC apps. Use AppleEvents to determine which files
  166.     are to be opened or printed from the Finder.
  167.     -- from "SegLoad.h"
  168. */
  169.  
  170. //==============================================================================
  171. // ShellPropAccessor
  172. //==============================================================================
  173.  
  174. //------------------------------------------------------------------------------
  175. // ShellPropAccessor::ShellPropAccessor
  176. //------------------------------------------------------------------------------
  177.  
  178. ShellPropAccessor::ShellPropAccessor(DescType property, RealShell* shell)
  179. {
  180. #ifdef TO_BE_DELETED
  181.     fProperty = property;
  182.     fShell = shell;
  183. #endif /* TO_BE_DELETED */
  184. }
  185.  
  186. //------------------------------------------------------------------------------
  187. // ShellPropAccessor::GetProperty
  188. //------------------------------------------------------------------------------
  189.  
  190. DescType ShellPropAccessor::GetProperty()
  191. {
  192. #ifdef TO_BE_DELETED
  193.     return fProperty;
  194. #endif /* TO_BE_DELETED */
  195. }
  196.  
  197. //------------------------------------------------------------------------------
  198. // ShellPropAccessor::GetShell
  199. //------------------------------------------------------------------------------
  200.  
  201. RealShell* ShellPropAccessor::GetShell()
  202. {
  203. #ifdef TO_BE_DELETED
  204.     return fShell;
  205. #endif /* TO_BE_DELETED */
  206. }
  207.  
  208.  
  209. //==============================================================================
  210. // ShellSelfPropAccessor
  211. //==============================================================================
  212.  
  213. //------------------------------------------------------------------------------
  214. // ShellSelfPropAccessor::ShellSelfPropAccessor
  215. //------------------------------------------------------------------------------
  216.  
  217. ShellSelfPropAccessor::ShellSelfPropAccessor(DescType property, RealShell* shell):
  218.     ShellPropAccessor(property, shell)
  219. {
  220. }
  221.  
  222. //------------------------------------------------------------------------------
  223. // ShellSelfPropAccessor::GetPropertyData
  224. //------------------------------------------------------------------------------
  225.  
  226. #ifdef TO_BE_DELETED
  227. void ShellSelfPropAccessor::GetPropertyData( AEDesc* result )
  228. {
  229. Environment* ev = somGetGlobalEnvironment();
  230.     switch(fProperty)
  231.     {
  232.         case pBestType:                    // Return the null descriptor representing
  233.         case pDefaultType:                // the application.
  234.             result->descriptorType = typeNull;
  235.             result->dataHandle = NULL;
  236.             break;
  237.             
  238.         case pClass:
  239.             DescType theType = cApplication;
  240.             THROW_IF_ERROR(AECreateDesc(typeType, (Ptr)&theType,
  241.                 sizeof(DescType), result));
  242.             break;
  243.             
  244.         case pName:
  245.         {
  246.             TempPlatformFile file(GetPlatformFileFromContainer(ev,this->GetShell()->GetDocument()->GetContainer(ev)));
  247.             TempODName name = file->GetName();
  248.             TempODString tempname = GetCStringFromIText(name);
  249.             THROW_IF_ERROR( AECreateDesc( typeChar, (char*)tempname,
  250.                     GetITextStringLength(name), result ) ) ;
  251.  
  252.             // delete tempname;
  253.             // ODDisposePtr(tempname);
  254.             // delete file;
  255.         }    break;
  256.  
  257.         case pIsFrontProcess:
  258.         {
  259.             ProcessSerialNumber curPSN = {0, kCurrentProcess}, myPSN;
  260.             ODBoolean isFront;
  261.             GetFrontProcess(&myPSN);
  262.             SameProcess(&myPSN, &curPSN, &isFront);
  263.             THROW_IF_ERROR(AECreateDesc(typeBoolean, (Ptr)&isFront,
  264.                     sizeof(Boolean), result));
  265.         }    break;
  266.             
  267.         case pVersion:
  268.         {
  269.         //    ODSShort refNum = CurResFile();
  270.         //    UseResFile(this->GetShellResFile());
  271.             Handle myHandle = (Handle)Get1Resource((ResType)'vers', 1);
  272.               HLock(myHandle);
  273.              OSErr err = AECreateDesc(typeVersion, *myHandle, GetHandleSize(myHandle),
  274.                     result);
  275.               HUnlock(myHandle);
  276.         //    UseResFile(refNum);                // reset back to resource previously set
  277.             THROW_IF_ERROR(err);
  278.         }    break;
  279.  
  280.         default:                // We don't handle the requested property.
  281.             THROW(errAEEventNotHandled);
  282.     }
  283. }
  284. #endif /* TO_BE_DELETED */
  285.  
  286. //------------------------------------------------------------------------------
  287. // ShellSelfPropAccessor::SetPropertyData
  288. //------------------------------------------------------------------------------
  289.  
  290. #ifdef TO_BE_DELETED
  291. void ShellSelfPropAccessor::SetPropertyData(AEDesc* data)
  292. {
  293.     ODUnused(data);
  294.     switch(fProperty)
  295.     {
  296.         case pBestType:                    // Return the null descriptor representing
  297.         case pDefaultType:                // the application.
  298.         case pClass:
  299.         case pName:
  300.         case pIsFrontProcess:
  301.         case pVersion:
  302.             THROW(errAENotModifiable);
  303.         default:                // We don't handle the requested property.
  304.             THROW(errAEEventNotHandled);
  305.     }
  306. }
  307. #endif /* TO_BE_DELETED */
  308.  
  309. //==============================================================================
  310. // ShellPartPropAccessor
  311. //==============================================================================
  312.  
  313. //------------------------------------------------------------------------------
  314. // ShellPartPropAccessor::ShellPartPropAccessor
  315. //------------------------------------------------------------------------------
  316.  
  317. #ifdef TO_BE_DELETED
  318. ShellPartPropAccessor::ShellPartPropAccessor(DescType property, RealShell* shell,
  319.         ODFrame* frame):
  320.     ShellPropAccessor(property, shell)
  321. {
  322.     fFrame = frame;
  323. }
  324. #endif /* TO_BE_DELETED */
  325.  
  326. //------------------------------------------------------------------------------
  327. // ShellPartPropAccessor::GetPropertyData
  328. //------------------------------------------------------------------------------
  329.  
  330. #ifdef TO_BE_DELETED
  331. void ShellPartPropAccessor::GetPropertyData(AEDesc* result)
  332. {
  333. Environment* ev = somGetGlobalEnvironment();
  334.     switch(fProperty)
  335.     {
  336.         case pBounds:
  337.         {
  338.             TempODShape theShape = fFrame->AcquireFrameShape(ev, kODNULL);
  339.             ODRect bounds;
  340.             theShape->GetBoundingBox(ev, &bounds);
  341.             Rect qdBounds;
  342.             bounds.AsQDRect(qdBounds);
  343.             THROW_IF_ERROR(AECreateDesc(typeQDRectangle, (Ptr)&qdBounds,
  344.                     sizeof(qdBounds), result));
  345.         }    break;
  346.         default:
  347.             THROW(errAEEventNotHandled);
  348.     }
  349. }
  350. #endif /* TO_BE_DELETED */
  351.  
  352. //------------------------------------------------------------------------------
  353. // ShellPartPropAccessor::SetPropertyData
  354. //------------------------------------------------------------------------------
  355.  
  356. #ifdef TO_BE_DELETED
  357. void ShellPartPropAccessor::SetPropertyData(AEDesc* data)
  358. {
  359. Environment* ev = somGetGlobalEnvironment();
  360.     switch(fProperty)
  361.     {
  362.         case pBounds:
  363.         {
  364.             ThrowIfCantCoerce(data, typeQDPoint);
  365.             Rect r;
  366.             ODBlockMove(*data->dataHandle, &r, sizeof(r));
  367.             
  368.             ODBoolean success;
  369.             { TempODShape newShape = new ODShape; // DMc refcount
  370.               ODRect xmpR = r;
  371.               newShape->SetRectangle(ev, &xmpR);
  372.               TempODShape resultShape = fFrame->RequestFrameShape(ev, newShape, kODNULL);
  373.               success = newShape->IsSameAs(ev, resultShape);
  374.             }
  375.  
  376.             if (!success)
  377.                 THROW(errAEEventNotHandled);
  378.  
  379.         }    break;
  380.         default:
  381.             THROW(errAEEventNotHandled);
  382.     }
  383. }
  384. #endif /* TO_BE_DELETED */
  385.  
  386. //==============================================================================
  387. // ShellDraftPropAccessor
  388. //==============================================================================
  389.  
  390. //------------------------------------------------------------------------------
  391. // ShellDraftPropAccessor::ShellDraftPropAccessor
  392. //------------------------------------------------------------------------------
  393.  
  394. #ifdef TO_BE_DELETED
  395. ShellDraftPropAccessor::ShellDraftPropAccessor( DescType property, RealShell* shell,
  396.         ODDraft* draft ):
  397.     ShellPropAccessor(property, shell)
  398. {
  399.     fDraft = draft;
  400. }
  401. #endif /* TO_BE_DELETED */
  402.  
  403. //------------------------------------------------------------------------------
  404. // ShellDraftPropAccessor::GetPropertyData
  405. //------------------------------------------------------------------------------
  406.  
  407. #ifdef TO_BE_DELETED
  408. void ShellDraftPropAccessor::GetPropertyData(AEDesc* result)
  409. {
  410. Environment* ev = somGetGlobalEnvironment();
  411.     switch(fProperty)
  412.     {
  413.         case pName:
  414. //        {
  415. //            ODDraftName name = fDraft->GetName(ev);
  416. //            THROW_IF_ERROR( AECreateDesc( typeChar, (Ptr)name, strlen(name),
  417. //                    result ) ) ;
  418. //        }    break;
  419.         default:
  420.             THROW(errAEEventNotHandled);
  421.     }
  422. }
  423. #endif /* TO_BE_DELETED */
  424.  
  425. //------------------------------------------------------------------------------
  426. // ShellDraftPropAccessor::SetPropertyData
  427. //------------------------------------------------------------------------------
  428.  
  429. #ifdef TO_BE_DELETED
  430. void ShellDraftPropAccessor::SetPropertyData(AEDesc* data)
  431. {
  432. Environment* ev = somGetGlobalEnvironment();
  433.     switch(fProperty)
  434.     {
  435.         case pName:
  436. //        {
  437. //            ThrowIfCantCoerce(data, typeChar);
  438. //            char theName[100] ;
  439.  
  440.             // <eeh> THIS IS NOT AN ISOSTRING!!!  Perhaps we need to look
  441.             // one up, or is this just something not to export?
  442.  
  443. //            long len = GetHandleSize( data->dataHandle ) ;
  444. //            ODBlockMove( *data->dataHandle, theName, len ) ;
  445. //            theName[len] = '\0' ;
  446. //            fDraft->SetName(ev,  (ODDraftName)theName ) ;
  447. //        }    break;
  448.         default:
  449.             THROW(errAEEventNotHandled);
  450.     }
  451. }
  452. #endif /* TO_BE_DELETED */
  453.  
  454. //==============================================================================
  455. // ShellFramePropAccessor
  456. //==============================================================================
  457.  
  458. //------------------------------------------------------------------------------
  459. // ShellFramePropAccessor::ShellFramePropAccessor
  460. //------------------------------------------------------------------------------
  461.  
  462. #ifdef TO_BE_DELETED
  463. // ShellFramePropAccessor::ShellFramePropAccessor(DescType property, RealShell* shell,
  464. //         ODFrame* frame):
  465. //     ShellPropAccessor(property, shell)
  466. // {
  467. //     fFrame = frame;
  468. // }
  469. #endif // TO_BE_DELETED
  470.  
  471. //------------------------------------------------------------------------------
  472. // ShellFramePropAccessor::GetPropertyData
  473. //------------------------------------------------------------------------------
  474.  
  475. #ifdef TO_BE_DELETED
  476. // void ShellFramePropAccessor::GetPropertyData(AEDesc* result)
  477. // {
  478. // Environment* ev = somGetGlobalEnvironment();
  479. //     switch(fProperty)
  480. //     {
  481. //         case pBounds:
  482. //         {
  483. //             ODShape* theShape = fFrame->GetFrameShape(ev);
  484. //             ODRect bounds;
  485. //             theShape->GetBoundingBox(ev, &bounds);
  486. //             Rect qdBounds;
  487. //             bounds.AsQDRect(qdBounds);
  488. //             THROW_IF_ERROR(AECreateDesc(typeQDRectangle, (Ptr)&qdBounds,
  489. //                     sizeof(qdBounds), result));
  490. //         }    break;
  491. //         default:
  492. //             THROW(errAEEventNotHandled);
  493. //     }
  494. // }
  495. #endif // TO_BE_DELETED
  496.  
  497. //------------------------------------------------------------------------------
  498. // ShellFramePropAccessor::SetPropertyData
  499. //------------------------------------------------------------------------------
  500.  
  501. #ifdef TO_BE_DELETED
  502. // void ShellFramePropAccessor::SetPropertyData(AEDesc* data)
  503. // {
  504. // Environment* ev = somGetGlobalEnvironment();
  505. //     switch(fProperty)
  506. //     {
  507. //         case pBounds:
  508. //         {
  509. //             ThrowIfCantCoerce(data, typeQDPoint);
  510. //             Rect r;
  511. //             ODBlockMove(*data->dataHandle, &r, sizeof(r));
  512. //             
  513. //             ODShape* newShape = new ODShape;
  514. //             ODRect xmpR = r;
  515. //             newShape->SetRectangle(ev, &xmpR);
  516. //             ODShape* resultShape = fFrame->RequestFrameShape(ev, newShape);
  517. //             ODBoolean success = newShape->IsSameAs(ev, resultShape);
  518. //            delete newShape;
  519. //            delete resultShape;
  520. //             if (!success)
  521. //                 THROW(errAEEventNotHandled);
  522. // 
  523. //         }    break;
  524. //         case kODPIsFrozen :
  525. //         case kXMPPIsStationery :
  526. //         case kODPView :
  527. // 
  528. //         default:
  529. //             THROW(errAEEventNotHandled);
  530. //     }
  531. // }
  532. #endif // TO_BE_DELETED
  533.  
  534. //==============================================================================
  535. // ShellWinPropAccessor
  536. //==============================================================================
  537.  
  538. //------------------------------------------------------------------------------
  539. // ShellWinPropAccessor::ShellWinPropAccessor
  540. //------------------------------------------------------------------------------
  541.  
  542. #ifdef TO_BE_DELETED
  543. ShellWinPropAccessor::ShellWinPropAccessor(DescType property, RealShell* shell,
  544.                                             ODWindow* window):
  545.     ShellPropAccessor(property, shell)
  546. {
  547.     fWindow = window;
  548. }
  549. #endif /* TO_BE_DELETED */
  550.  
  551. //------------------------------------------------------------------------------
  552. // ShellWinPropAccessor::GetName
  553. //------------------------------------------------------------------------------
  554.  
  555. #ifdef TO_BE_DELETED
  556. void ShellWinPropAccessor::GetName(StringPtr name)
  557. {
  558. Environment* ev = somGetGlobalEnvironment();
  559. //    WindowPeek    window = (WindowPeek)fWindow->GetPlatformWindow(ev);
  560.  
  561.     GetWTitle(fWindow->GetPlatformWindow(ev), name);
  562. //    CopyPascalString(name, *(window->titleHandle));
  563. }
  564. #endif /* TO_BE_DELETED */
  565.  
  566. //------------------------------------------------------------------------------
  567. // ShellWinPropAccessor::GetPropertyData
  568. //------------------------------------------------------------------------------
  569.  
  570. #ifdef TO_BE_DELETED
  571. void ShellWinPropAccessor::GetPropertyData(AEDesc* result)
  572. {
  573.     Str255 name;
  574.  
  575. Environment* ev = somGetGlobalEnvironment();
  576.     switch(fProperty)
  577.     {
  578. #ifdef TO_BE_DELETED
  579.         case pPosition:
  580.             Rect bounds;
  581.             bounds=(**(((WindowRecord*)fWindow->GetPlatformWindow(ev))->contRgn))
  582.                     .rgnBBox;
  583.             THROW_IF_ERROR(AECreateDesc(typeQDPoint, (Ptr)&bounds,
  584.                     sizeof(Point), result));
  585.             break;
  586. #endif // TO_BE_DELETED
  587.         case pBounds :
  588.             Rect bounds=(**(((WindowRecord*)fWindow->GetPlatformWindow(ev))->contRgn))
  589.                     .rgnBBox;
  590.             THROW_IF_ERROR(AECreateDesc(typeQDRectangle, (Ptr)&bounds,
  591.                     sizeof(bounds), result));
  592.             break;
  593.         case pName :
  594.             this->GetName(name);
  595.             THROW_IF_ERROR(AECreateDesc(typeChar, (Ptr)&name[1], name[0], result));
  596.             break;
  597.         default :
  598.             THROW(errAENotAnElement);    // really want "not a property"
  599.     }
  600. }
  601. #endif /* TO_BE_DELETED */
  602.  
  603. //------------------------------------------------------------------------------
  604. // ShellWinPropAccessor::SetPropertyData
  605. //------------------------------------------------------------------------------
  606.  
  607. #ifdef TO_BE_DELETED
  608. void ShellWinPropAccessor::SetPropertyData(AEDesc* data)
  609. {
  610. Environment* ev = somGetGlobalEnvironment();
  611.     WindowPtr window = fWindow->GetPlatformWindow(ev);
  612.     Str255 name;
  613.     unsigned long len;
  614.  
  615.     switch(fProperty)
  616.     {
  617. #ifdef TO_BE_DELETED
  618.          case pPosition:
  619.             Point upperLeft;
  620.             ThrowIfCantCoerce(data, typeQDPoint);
  621.             ODBlockMove(*(data->dataHandle), &upperLeft, sizeof(upperLeft));
  622.             MoveWindow(window, upperLeft.h, upperLeft.v, false);
  623.             InvalRect(&window->portRect);
  624.             break;
  625. #endif // TO_BE_DELETED
  626.  
  627.         case pBounds :
  628.             Rect bounds;
  629.             ThrowIfCantCoerce(data, typeQDRectangle);
  630.             ODBlockMove(*(data->dataHandle), &bounds, sizeof(bounds));
  631.             MoveWindow(window, bounds.left, bounds.top, fWindow->IsActive(ev));
  632.             SizeWindow(window, bounds.right - bounds.left,
  633.                     bounds.bottom - bounds.top, true);
  634.             break;
  635.  
  636.         case pName :
  637.             ThrowIfCantCoerce(data, typeChar);
  638.             len = GetHandleSize(data->dataHandle);
  639.             if (len >= 0xFF) THROW(errAECorruptData);
  640.             ODBlockMove(*(data->dataHandle), &name[1], len);
  641.             name[0] = (unsigned char)len;
  642.             SetWTitle(window, name);
  643.             break;
  644.  
  645.         default :
  646.             THROW(errAENotAnElement);    // really want "not a property"
  647.     }
  648. }
  649. #endif /* TO_BE_DELETED */
  650.